package main

import (
	"pay_service/internal/db"
	"pay_service/internal/dotenv"

	genModel "pay_service/biz/model/orm_gen"

	"gorm.io/gen"
)

func main() {
	dotenv.Init()
	db.Init()

	g := gen.NewGenerator(gen.Config{
		OutPath:      "./biz/model/query",
		ModelPkgPath: "./biz/model/orm_gen",
		Mode:         gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface, // generate mode
	})

	g.UseDB(db.DB)

	// Generate struct `User` based on table `users`
	g.GenerateModel("pay_order")

	g.ApplyBasic(genModel.PayOrder{})

	// Generate the code
	g.Execute()
}
